<template>
	<view class="topup">
		<u-input placeholder="请输入充值金额" v-model="TopValue" />
		<u-button type="warning" text="确认充值" shape="circle" @click="Click()"></u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				TopValue:''
			}
		},
		methods: {
			Click(){
				this.$http({
					url:"/member/rechargeBalance",
					data:{
						rechargePrice:this.TopValue,
						memberId:"17522372"
					}
				}).then(res=>{
					if(res.data.data == true){
						uni.showToast({
							title:'充值成功',
						}).then(setTimeout(()=>{
							uni.switchTab({
								url:"/pages/index/index"
							})
						},2000))
					}else{
						uni.showToast({
							title:res.data.message,
							icon:'error'
						})
					}
				})
			}
		}
	}
</script>

<style>
.u-input{
	width: 80%;
	margin: 20rpx auto auto auto;
}
.u-button{
	margin-top: 50rpx;
	width: 90%;
}
.topup{
	overflow: hidden;
}
</style>
